/*client2对http服务器进行超时时间测试看服务器是否关闭client*/

#include "../http.hpp"

int main()
{
    Socket client;
    int fd = client.CreateClient(8085,"117.72.116.235");
                        //1:请求行                2.请求头部                             3.空行  4. 请求正文：（这里为空）
    std::string req = "GET /hello HTTP/1.1\r\nConnection: keep-alive\r\nContent-Length: 0\r\n\r\n";
    while(1)
    {
        assert(client.Send(req.c_str(),req.size()) != -1);

        char buf[1024] = {0};//接收响应
        assert(client.Recv(buf,1023) != -1);

        DEBUG_LOG("[%s]",buf);

        sleep(15);
        //DEBUG_LOG("%d",fd);
    }
    client.Close();
    return 0;
}